<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>

<title></title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<link rel="stylesheet" type="text/css"
	href="<c:url value="/css/application.css"></c:url>">
<link rel="stylesheet" type="text/css"
	href="<c:url value="/css/list.css"></c:url>">

<script type="text/javascript">
    
       function removeHotel(hotelNo,hotelName){
          if(confirm("确认要删除分店["+hotelName+"]的信息吗?")){
            location.href='<c:url value="hotelMgr?act=remove"/>&hotelno='+hotelNo;
          }
       }
       
       function updateHotel(hotelNo){
          location.href='<c:url value="hotelMgr?act=forUpdate"/>&hotelno='+hotelNo;      
       }
    
    </script>
</head>

<body>
	<c:if test="${not empty err}">
		<script type="text/javascript">
			alert('${err}');
		</script>
	</c:if>
	<div id="wrapper">
		<div id="title">分店信息列表</div>
		<div>
			<table id="listtable" cellpadding="0" cellspacing="0">
				<tr>
					<th>编号</th>
					<th>分店名称</th>
					<th>分店地址</th>
					<th>联络电话</th>
					<th>房间总数</th>
					<th>操作</th>
				</tr>
				<c:forEach var="hotel" items="${hotelList}">
					<tr>
						<td>${hotel.hotelNo}</td>
						<td>${hotel.hotelName}</td>
						<td>${hotel.hotelAddr}</td>
						<td>${hotel.hotelPhone}</td>
						<td>${hotel.hotelRoomCount}</td>
						<td>
							<button title="点击修改分店[${hotel.hotelName}]"
								onclick="updateHotel(${hotel.hotelNo});">修 改</button>
							<button title="点击删除分店[${hotel.hotelName}]"
								onclick="removeHotel(${hotel.hotelNo},'${hotel.hotelName}');">
								删 除</button>
						</td>
					</tr>
				</c:forEach>
			</table>
		</div>
	</div>

</body>
</html>
